package com.mdd.front.service.order;

import com.github.binarywang.wxpay.exception.WxPayException;
import com.mdd.common.core.PageResult;
import com.mdd.common.entity.order.Order;
import com.mdd.common.entity.order.RechargeOrder;
import com.mdd.front.validate.OrderParam;
import com.mdd.front.validate.PageParam;
import com.mdd.front.validate.RechargeOrderParam;
import com.mdd.front.vo.order.OrderDetailVo;
import com.mdd.front.vo.order.OrderListVo;
import com.mdd.front.vo.order.RechargeOrderDetailVo;
import com.mdd.front.vo.order.RechargeOrderListVo;

import java.util.Map;

/**
 * 充值订单服务接口类
 * @author panweiliang
 */
public interface IRechargeOrderService {

    /**
     * 根据id获取订单数据
     *
     * @author panweiliang
     * @param id 主键ID
     * @return RechargeOrderDetailVo
     */
    RechargeOrderDetailVo getDetailById(Integer id);

    RechargeOrder getById(Integer id);

    /**
     * 更改订单单号
     * @param id
     * @return
     */
    RechargeOrder updateSn(Integer id);

    /**
     * 订单新增
     *
     * @author panweiliang
     * @param rechargeOrderParam 参数
     */
    RechargeOrderDetailVo add(RechargeOrderParam rechargeOrderParam) throws WxPayException;

    /**
     * 将订单状态改为已支付
     * @param outTradeNo
     * @param transactionId
     */
    boolean updateOrderStatusToPaid(String outTradeNo, String transactionId) throws WxPayException;

    /**
     * 将订单状态改为已支付
     * @param rechargeOrderId
     */
    boolean updateOrderPayStatusToPaid(Integer rechargeOrderId) throws WxPayException;


    /**
     * 获取充值记录
     * @param pageParam
     * @param userId
     * @return
     */
    PageResult<RechargeOrderListVo> list(PageParam pageParam, Integer userId);
}
